from django.urls import path
from . import views
from django.contrib.auth import views as auth_views

urlpatterns = [
    # 基本页面
    path('', views.home, name='home'),
    path('register/', views.register, name='register'),
    path('login/', views.user_login, name='login'),
    path('logout/', views.user_logout, name='logout'),
    path('profile/', views.profile, name='profile'),
    
    # 汽车数据页面
    path('cars/', views.car_list, name='car_list'),
    path('cars/<int:series_id>/', views.car_detail, name='car_detail'),
    path('charts/', views.car_charts, name='car_charts'),
    path('cars/add/', views.edit_car, name='add_car'),
    path('cars/edit/<int:series_id>/', views.edit_car, name='edit_car'),
    path('cars/delete/<int:series_id>/', views.delete_car, name='delete_car'),
    
    # API
    path('api/cars/', views.api_car_data, name='api_car_data'),
    
    # 管理员页面
    path('admin/', views.admin_dashboard, name='admin_dashboard'),
    path('admin/users/edit/<int:user_id>/', views.admin_user_edit, name='admin_user_edit'),
    path('admin/users/delete/<int:user_id>/', views.admin_user_delete, name='admin_user_delete'),
    
    # 密码重置
    path('password-reset/', auth_views.PasswordResetView.as_view(template_name='car_system/password_reset.html'), name='password_reset'),
    path('password-reset/done/', auth_views.PasswordResetDoneView.as_view(template_name='car_system/password_reset_done.html'), name='password_reset_done'),
    path('password-reset-confirm/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(template_name='car_system/password_reset_confirm.html'), name='password_reset_confirm'),
    path('password-reset-complete/', auth_views.PasswordResetCompleteView.as_view(template_name='car_system/password_reset_complete.html'), name='password_reset_complete'),
] 